package com.uqbar.asteroids.components;

import java.awt.Color;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.appearances.Circle;

public class StandardShoot extends CircleShoot{
	
	public StandardShoot(double posIniX, double posIniY, int grupo, Vector2D velocidadInercial){
		super(3,velocidadInercial, posIniX,posIniY,300);
		this.setAppearance(new Circle(Color.LIGHT_GRAY, 2*this.radio));
		this.dmg = 10;
		this.grupo = grupo;
		this.applyBulletSpeed();
	}


	public void applyBulletSpeed() {
		this.velocidad = this.velocidad.suma(new Vector2D(this.bulletSpeed, 0)).toCartesians();
	}


	@Override
	public void update(DeltaState deltaState) {
		if(active){
		if(this.outofScreen()){
			this.getScene().shootToPool(this);
		}
		Vector2D newDelta = this.velocidad.producto(deltaState.getDelta());
		this.setX(this.getX() + newDelta.getX());
		this.setY(this.getY() + newDelta.getY());
		}
	}
}
